[PATCH] ws: get a new mask for each new outgoing frame
Reported-by: Calvin Ruocco
Closes #18496
Backported-by: Samuel Henrique <samueloph@debian.org>
Backported-by: Alex <alex@puer-robustus.eu>
Changes:
* Refresh patch context for lib/ws.c
* Adapt return value to current function return type
Backported by: Samuel Henrique <samueloph@debian.org>
Changes:
* Apply the per-frame mask generation in ws_packethead() (bookworm
7.88.1) rather than upstream's ws_enc_add_frame() (and trixie's
ws_enc_write_head()), since the bookworm code path that builds the
outgoing frame header is structurally different. On Curl_rand()
failure return 0 -- ws_packethead() already uses 0 as the
soft-error sentinel for buffer-too-small.
* Preserve the DEBUGBUILD CURL_WS_FORCE_ZERO_MASK escape hatch
alongside the new per-frame mask generation, matching upstream.
* Remove the corresponding one-time mask generation in
Curl_ws_accept(), and initialise `result` to CURLE_OK at
declaration since it is no longer unconditionally assigned by the
removed Curl_rand() call.
Gbp-Pq: Name CVE-2025-10148.patch